import motor.motor_asyncio
import pprint
import asyncio

client = motor.motor_asyncio.AsyncIOMotorClient('localhost', 27017)
db = client.temp
col = db.test_collection

async def do_find_one():
    document = await col.find_one({"i": {"$lt": 1}})
    # pprint模块，pprint函数使数据显示得更加美观
    pprint.pprint(document)

loop = client.get_io_loop()
loop.run_until_complete(do_find_one())